import axios from "./confing";

//定义请求接口

//登入
export const loginApi = (username, password) =>
  axios.post("/users/login", {
    username,
    password,
  });

//获取验证码
export const captchaApi = () => axios.get("/users/getCaptcha");

//校验验证码
export const verifyApi = (captcha) =>
  axios.get("/users/verifyCaptcha", {
    params: { captcha },
  });

//获取二维码地址
export const getCodeApi = () => axios.get("/users/getScancode");

//二维码登入
export const erweiLoginApi = (wechatCode) =>
  axios.get("/users/wechatLogin", {
    params: { wechatCode },
  });

//登入日志
export const loginLogApi = (page = 1, count = 10) =>
  axios.get("/getloginlog", {
    params: {
      page,
      count,
    },
  });

//获取权限菜单==>需要用户登录之后才可以获取
export const menuListApi = () => axios.get("/permission/getMenuList");
